from mainapp import  app
from flask_script import Manager
from mainapp.views.student_route import blue
from modules import db


@blue.route('/index')
def index():
    return '<h1>欢迎来到主页面</h1>'
@blue.route('/creatTable')
def creat_table():
    db.create_all()
    return '数据库模型创建成功'
@blue.route('/dropTable')
def drop_table():
    db.drop_all()
    return '数据库模型删除成功'
if __name__ == '__main__':
    #注册蓝图
    app.register_blueprint(blue, url_prefix='/start')
    #注册数据库
    db.init_app(app)
    manager = Manager(app)
    manager.run()